<?php
class My_Date
{
    public static function fomatDbDate($date = null, $seperator = '/')
    {
        if ($date) {
            $time = explode($seperator, $date);
            $time = mktime(0, 0, 0, $time[1], $time[0], $time[2]);
        } else {
            $time = time();
        }
        return date('Y-m-d', $time);
    }

    public static function parseDbDate($date = null)
    {
        if ($date) {
            $time = strtotime($date);
        } else {
            $time = time();
        }
        return date('d/m/Y', $time);
    }
}